package com.cysoft.domain;

import java.util.List;

/**
 * 轮型，process
 */
public class Wheel extends AbstractPersistable{
    private String wheelCode;//任务的编码

    /**
     * 轮型
     */
    private String wheelName;

    /**
     * 需要的模具，可能有共模的可能
     */
    private List<Mold> moldList;

    /**
     * 生产耗时，分钟
     */
    private float costTime;

    private WheelTechType wheelTechType;
    private List<FilterType> filterTypeList;

    public Wheel() {
    }

    public Wheel(long id, String wheelCode, String wheelName, float costTime) {
        super(id);
        this.wheelCode = wheelCode;
        this.wheelName = wheelName;
        this.costTime = costTime;
    }

    public Wheel(String wheelCode, String wheelName, List<Mold> moldList, float costTime, WheelTechType wheelTechType, List<FilterType> filterTypeList) {
        this.wheelCode = wheelCode;
        this.wheelName = wheelName;
        this.moldList = moldList;
        this.costTime = costTime;
        this.wheelTechType = wheelTechType;
        this.filterTypeList = filterTypeList;
    }

    public Wheel(long id, String wheelCode, String wheelName, List<Mold> moldList, float costTime, WheelTechType wheelTechType, List<FilterType> filterTypeList) {
        super(id);
        this.wheelCode = wheelCode;
        this.wheelName = wheelName;
        this.moldList = moldList;
        this.costTime = costTime;
        this.wheelTechType = wheelTechType;
        this.filterTypeList = filterTypeList;
    }

    public List<FilterType> getFilterTypeList() {
        return filterTypeList;
    }

    public String getFilterTypeStr() {
        if(filterTypeList.isEmpty()) {
            return "未知";
        }
        String desc = "";
        for (FilterType type :filterTypeList) {
            if(type.equals(FilterType.TIEWANG)) {
                desc += "铁网";
            }
            if(type.equals(FilterType.XIANWEI)) {
                desc += "纤维";
            }
        }
        return desc;
    }
    public void setFilterTypeList(List<FilterType> filterTypeList) {
        this.filterTypeList = filterTypeList;
    }

    public String getWheelCode() {
        return wheelCode;
    }

    public void setWheelCode(String wheelCode) {
        this.wheelCode = wheelCode;
    }

    public String getWheelName() {
        return wheelName;
    }

    public void setWheelName(String wheelName) {
        this.wheelName = wheelName;
    }


    public float getCostTime() {
        return costTime;
    }

    public void setCostTime(float costTime) {
        this.costTime = costTime;
    }

    public List<Mold> getMoldList() {
        return moldList;
    }

    public void setMoldList(List<Mold> moldList) {
        this.moldList = moldList;
    }

    public WheelTechType getWheelTechType() {
        return wheelTechType;
    }

    public void setWheelTechType(WheelTechType wheelTechType) {
        this.wheelTechType = wheelTechType;
    }
}